<!DOCTYPE html>
<html>

<head>
    <title>用户基础信息表</title>
    <#include "/header.html">
</head>

<body>
<div id="rrapp" v-cloak>
    <!--查询start-->
    <div v-show="showList">
        <div class="grid-btn">
            <form class="form-inline" role="form">
                <div class="form-group">
                    <a @click="reset">
                        <i class="fa fa-refresh"></i>
                    </a>
                </div>&nbsp;&nbsp;&nbsp;

                <div class="form-group">
                    <input type="text" class="form-control input-sm" v-model="q.username" placeholder="会员名">
                </div>&nbsp;&nbsp;&nbsp;

                <div class="form-group">
                    <input type="text" class="form-control input-sm" v-model="q.mobile" placeholder="手机号码">
                </div>&nbsp;&nbsp;&nbsp;

                <div class="form-group">
                    <select class="form-control input-sm" v-model="q.userType">
                        <option disabled value="">会员类型</option>
                        <option v-for="item in userTypeEnum" :value="item.value">{{item.describe}}</option>
                    </select>
                </div>&nbsp;&nbsp;&nbsp;

                <div class="form-group">
                    <input class="form-control input-sm" v-model="q.beginCreatetime" @keyup.enter="query" @click="checkBeginDate" placeholder="注册时间" />
                    <label>至</label>
                    <input class="form-control input-sm" v-model="q.endCreatetime" @keyup.enter="query" @click="checkEndDate" placeholder="结束时间"/>
                </div>&nbsp;&nbsp;&nbsp;

                <a class="btn btn-primary btn-sm " @click="query"> <i class="fa fa-search"></i>&nbsp;查询</a>
                <a class="btn btn-primary btn-sm" @click="add"> <i class="fa fa-plus"></i>&nbsp;新增会员</a>
                <a class="btn btn-primary btn-sm " @click="changePassword"> <i class="fa fa-eraser"></i>&nbsp;修改密码</a>
                <a class="btn btn-primary btn-sm" @click="del"> <i class="fa fa-trash-o"></i>&nbsp;删除会员</a>

        </form>
    </div>
    <table id="jqGrid"></table>
    <div id="jqGridPager"></div>
</div>
<!--查询end-->
<!--编辑start-->
<div v-show="showListUpdate" class="panel panel-default" align="center">
    <div class="panel-heading">{{title}}</div>
    <form class="form-horizontal" id="userInfoForm">
        <input type="hidden" v-model="userBaseInfo.userId" id="a_memberId" name="userId">
        <div class="form-group">
            <div class="col-sm-3 control-label">会员姓名</div>
            <div class="col-sm-10">
                <input type="text" class="form-control input-sm" v-model="userBaseInfo.name" placeholder="会员姓名" readonly name="name"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-3 control-label"><span style="color: red">*&nbsp;</span>手机号码</div>
            <div class="col-sm-10">
                <input type="text" class="form-control input-sm" v-model="userBaseInfo.mobile" placeholder="手机号码" name="mobile" readonly/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-3 control-label">邮箱地址</div>
            <div class="col-sm-10">
                <input type="text" class="form-control input-sm" v-model="userBaseInfo.email" placeholder="邮箱地址" name="email"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-3 control-label"><span style="color: red">*&nbsp;</span>会员类型</div>
            <div class="col-sm-10">
                <select v-model="userBaseInfo.userType" class="form-control input-sm" name="userType">
                    <option v-for="item in userTypeEnum" :value="item.value">{{item.describe}}</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-3 control-label"><span style="color: red">*&nbsp;</span>会员等级</div>
            <div class="col-sm-10">
                <select v-model="userBaseInfo.id" class="form-control input-sm" name="userLvId">
                    <option value="1">贵宾会员</option>
                    <option value="2">黄金会员</option>
                    <option value="3">白金会员</option>
                    <option value="4">特殊贵宾</option>
                    <option value="5">测试VIP</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-3 control-label">地址</div>
            <div class="col-sm-10">
                <input type="text" class="form-control input-sm" v-model="userBaseInfo.address" placeholder="地址" name="address"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-3 control-label">所属客服</div>
            <div class="col-sm-10">
                <el-select clearable style="padding-right: 180px;width: 550px;" name="adminUserId" size="small"
                           v-model="userBaseInfo.adminUserId"
                           filterable
                           remote
                           reserve-keyword
                           placeholder="所属客服"
                           :remote-method="remoteMethod"
                           :loading="loading">
                    <el-option
                            v-for="item in options"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                    </el-option>
                </el-select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-3 control-label">业务员</div>
            <div class="col-sm-10">
                <el-select clearable style="padding-right: 180px;width: 550px;" name="salesmanId" size="small"
                           v-model="userBaseInfo.salesmanId"
                           filterable
                           remote
                           reserve-keyword
                           placeholder="业务员"
                           :remote-method="remoteMethod"
                           :loading="loading">
                    <el-option
                            v-for="item in options"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                    </el-option>
                </el-select>
            </div>

        </div>
        <div class="form-group">
            <div class="col-sm-3 control-label">推荐码</div>
            <div class="col-sm-10">
                <input type="text" class="form-control input-sm" v-model="userBaseInfo.recommendCode" placeholder="推荐码" name="recommendCode"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-3 control-label">回款周期</div>
            <div class="col-sm-10">
                <input type="text" class="form-control input-sm" v-model="userBaseInfo.periodDay" placeholder="回款周期" name="periodDay"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-4 control-label"></div>
            <input type="button" class="btn btn-primary btn-sm pull-left" style="width: 100px;height: 30px;" @click="update" value="确定"
            /> &nbsp;&nbsp;
            <input type="button" class="btn btn-warning " style="width: 100px;height: 30px;" @click="close" value="返回" />
        </div>
    </form>
</div>
<!--编辑end-->
<!--用户详情start-->
<div v-show="showDetail" class="panel panel-default" align="center">
    <el-row :gutter="20">
        <el-col :span="4" :offset="20"><div class="grid-content bg-purple"> <input type="button" class="btn btn-primary btn-sm pull-right"  @click="close" value="返回" /></div></el-col>
    </el-row>

    <div class="panel-heading">{{title}}</div>
    <div class="panel-body">
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span12">
                    <table class="table" align="center" border="0" frame=void>
                        <tr><td>会员姓名:{{userBaseInfo.name}}</td><td>手机号码:{{userBaseInfo.mobile}}</td><td>邮箱:{{userBaseInfo.email}}</td><td v-if="userBaseInfo.userType=='common'">会员类型:一般用户</td>
                        <td v-else-if="userBaseInfo.userType=='shop'">会员类型:图文店用户</td><td v-else-if="userBaseInfo.userType=='company'">会员类型:企业用户</td>
                            <td v-else-if="userBaseInfo.userType=='designer'">会员类型:设计师</td><td v-else-if="userBaseInfo.userType=='supplier'">会员类型:供应商</td></tr>
                        <tr><td>回款周期:{{userBaseInfo.periodDay}}</td><td>注册日期:{{timestampToTime(userBaseInfo.regtime)}}</td><td>注册IP:{{userBaseInfo.regIp}}</td><td>推荐码:{{userBaseInfo.userId}}</td></tr>
                        <tr><td>预存款:{{userBaseInfo.advance}}</td><td>经验值:{{userBaseInfo.experience}}</td><td>积分:{{userBaseInfo.point}}</td><td>当前信用额:{{userBaseInfo.creditUse}}</td></tr>
                        <!--<tr><td>会员等级:{{userBaseInfo.memberName}}</td><td>地址:{{userBaseInfo.address}}</td><td>所属客服:{{userBaseInfo.adminUserId}}</td><td>业务员ID:{{userBaseInfo.salesmanId}}</td></tr>-->
                        <tr><td>会员等级:{{userBaseInfo.memberName}}</td><td>地址:{{userBaseInfo.address}}</td><td></td><td>信用额度:{{userBaseInfo.creditLimit}}</td></tr>
                    </table>
                </div>
            </div>
        </div>
    </div>


    <div class="row">
        <div class="col-md-6">
            <table id="jqGrid1"></table>
            <div id="jqGridPager1"></div>
        </div>
        <div class="col-md-6">
            <table id="jqGrid2"></table>
            <div id="jqGridPager2"></div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-6">
            <table id="jqGrid3"></table>
            <div id="jqGridPager3"></div>
        </div>
        <div class="col-md-6">
            <table id="jqGrid4"></table>
            <div id="jqGridPager4"></div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-6">
            <table id="jqGrid5"></table>
            <div id="jqGridPager5"></div>
        </div>
        <div class="col-md-6">
            <div class="form-group">
                <div class="col-md-4 control-label"></div>

            </div>
        </div>
    </div>

</div>
<!--用户详情end-->
<!--会员充值start-->
<div v-show="showMemRecharge" class="panel panel-default" align="center">
    <div class="panel-heading">{{title}}</div>
    <form class="form-horizontal" id="mempayForm">
        <input type="hidden" name="userId" v-model="userBaseInfo.userId">
        <div class="form-group">
            <div class="col-sm-3 control-label"></div>
            <div class="col-sm-10">
                <span class="input-group-addon">当前预存款</span>
                <input type="text" class="form-control input-sm" v-model="userBaseInfo.advance" readonly style="background-color: white">
                <span class="input-group-addon">当前信用额</span>
                <input type="text" class="form-control input-sm" v-model="userBaseInfo.creditUse" readonly style="background-color: white">
                <span class="input-group-addon">当前积分</span>
                <input type="text" class="form-control input-sm" v-model="userBaseInfo.point" readonly style="background-color: white">
                <span class="input-group-addon">当前经验值</span>
                <input type="text" class="form-control input-sm" v-model="userBaseInfo.experience" readonly style="background-color: white">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-3 control-label">选择充值类型</div>
            <div class="col-sm-10">
                <select class="form-control input-sm" name="rechargeType" v-model="rechargeType">
                    <option value="advance" selected>预存款</option>
                    <option value="creditUse">信用额度</option>
                    <option value="point">积分</option>
                    <option value="experience">经验值</option>
                </select>
                <!--<span v-show="rechargeType=='creditUse'" style="color: red;float: left">用户信用额度:{{userBaseInfo.creditLimit}}</span>-->
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-3 control-label"><span style="color: red">*&nbsp;</span>充值金额</div>
            <div class="col-sm-10">
                <input type="text" class="form-control input-sm" placeholder="充值金额" name="rechargeCount" id="rechargeCount"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-3 control-label">充值推荐码</div>
            <div class="col-sm-10">
                <input type="text" class="form-control input-sm" placeholder="推荐码" name="rechargeCode"/>
                <span style="color: red" class="pull-left">填写推荐该用户充值的业务员的推荐码,可以为空</span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-3 control-label">备注</div>
            <div class="col-sm-10">
                <input type="text" class="form-control input-sm" placeholder="备注" name="message"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-4 control-label"></div>
            <input type="button" class="btn btn-primary input-sm pull-left" @click="memRecharge" value="确定"
            /> &nbsp;&nbsp;
            <input type="button" class="btn btn-warning input-sm" @click="close" value="返回" />
        </div>
    </form>
</div>
<!--会员充值end-->
<!--新增会员start-->
<div v-show="showAddMem" class="panel panel-default">
    <div class="panel-heading">{{title}}</div>

    <el-row>
        <el-col :span="6" :offset="6">
    <el-form label-width="80px" id="addMemForm" v-loading="loading" element-loading-text="正在注册,请勿取消!" element-loading-spinner="el-icon-loading">
        <el-form-item label="会员名" ref="dataForm" style="margin-top: 20px">
            <el-input name="name" v-model="name"></el-input>
        </el-form-item>
        <el-form-item label="手机号码">
            <el-input name="mobile" v-model="mobile"></el-input>
        </el-form-item>
        <el-form-item label="输入密码">
            <el-input name="password" type="password" v-model="password"></el-input>
        </el-form-item>
        <el-form-item label="确认密码">
            <el-input name="npassword" type="password" v-model="npassword"></el-input>
        </el-form-item>
        <el-form-item>
            <el-button type="primary" @click="addMem" :disabled="checkbtn">提交</el-button>
            <el-button @click="close">取消</el-button>
        </el-form-item>
    </el-form>
        </el-col>
    </el-row>
</div>
<!--新增会员end-->
<!--修改密码start-->
    <el-dialog  title="修改密码" :visible.sync="changePwd" width="30%">
        <el-form>
            <el-form-item label="输入新密码">
                <el-input v-model="password1" type="password"></el-input>
            </el-form-item>
         </el-form>
        <el-form>
            <el-form-item label="确认新密码">
                <el-input v-model="password2" type="password"></el-input>
        </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
                <el-button @click="changePwd = false">取 消</el-button>
                <el-button type="primary" @click="resetPassword">确 定</el-button>
            </div>
    </el-dialog>
<!--修改密码end-->


</div>
<script src="${request.contextPath}/statics/js/modules/member/userbaseinfoMall.js?_${.now?long}"></script>
</body>

</html>
